import '../public.dart';

class HomeService {
  static Future<BaseConfig> getGlobalConfig() async {
    Map<String, dynamic> config = SpUtil.getObject('baseConfig');
    if (config == null) {
      config = await ACGN.http
          .fetch(AppConfig.configUrl, isParse: false)
          .then((res) {
        return res;
      });
      await SpUtil.putObject('baseConfig', config);
    }
    return BaseConfig.fromJson(config);
  }

  dynamic getHomeData() async {
    return ACGN.http
        .fetch(ACGN.config.interfaceApi.flowRecommend, isParse: false);
  }
}
